<%@ page language="java" 
         contentType="text/html; charset=windows-1256"
         pageEncoding="windows-1256"
         import="CreatorUtil.*"
         import="LoginUtil.*"
         import="java.sql.*"
         import="persistent.*"
         import="com.db4o.ObjectContainer"
         import="com.db4o.ObjectSet"
   %>
   
 <% User currentUser = (User) (session.getAttribute("currentSessionUser"));
 	/* if the current user is null or if he/she is not an Admin, Doctor, or Nurse */
 	if(currentUser == null || !(currentUser.getUserType() == User.UserType.Admin 
 							|| currentUser.getUserType() == User.UserType.Doctor 
 							|| currentUser.getUserType() == User.UserType.Nurse))
 	{
 		response.sendRedirect("login.jsp");
 	}
 	
 	TreatmentRecord viewedRecord = (TreatmentRecord)session.getAttribute("KEY_VIEWING_RECORD");
    //ObjectContainer container = Db4oServletListener.getObjectContainer(this.getServletContext());

 	
 	%>
 	
    <html>
      <head>
         <meta http-equiv="Content-Type" 
            content="text/html; charset=windows-1256">
         <title>  Modify Treatment Record  </title>
         <link rel="stylesheet" type="text/css" href="style.css" />
         
      </head>
   
   <body>
   	<center>
   	<br/><br/><br/><br/>
   	<div id="header">Modify the Treatment Record below.</div>
   	<br/><br/><br/><br/>
   	
   	<FORM NAME="modifyTreatmentRecordForm" ACTION="ModifyTreatmentRecordServlet" METHOD="GET">
   		<table cellpadding="5" border="1" style="foreground-color: #000000;">
   			<tr><th>Date: </th><td><%= viewedRecord.getDate() %></td></tr>
   			<tr><th>Patient: </th><td><%= viewedRecord.getPatient().getFirstName() %> <%= viewedRecord.getPatient().getLastName() %> </td></tr>
   			<tr><th>Doctor: </th><td><%= viewedRecord.getDoctor().getFirstName() %> <%= viewedRecord.getDoctor().getLastName() %> </td></tr>
   			<tr><th>Nurse: </th><td><%= viewedRecord.getNurse().getFirstName() %> <%= viewedRecord.getNurse().getLastName() %> </td></tr>
			<tr><th>Weight: </th><td><%= viewedRecord.getWeight() %></td></tr>
			<tr><th>Recommendations: </th><td><%= viewedRecord.getRecommendations() %> </td></tr>
			<tr><th>Paid: </th><td><%= Boolean.toString(viewedRecord.getPaid()) %> </td></tr>
   			
   		
   		</table>
   </FORM>
   </center>
   </body>
 </html>
   